<html>
<head><meta charset="utf-8"><title>NRVO · t-compiler/performance · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/index.html">t-compiler/performance</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html">NRVO</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="203670357"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203670357" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203670357">(Jul 13 2020 at 01:26)</a>:</h4>
<p><span class="user-mention" data-user-id="118594">@ecstatic-morse</span> The perf improvements from <a href="https://github.com/rust-lang/rust/pull/72205">dumb NRVO</a> were quite nice. Are there any plans for making it smarter?</p>



<a name="203761633"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203761633" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203761633">(Jul 13 2020 at 19:45)</a>:</h4>
<p>The conditions for MIR to be eligible for the simple NRVO transform are listed <a href="https://github.com/rust-lang/rust/blob/9d09331e00b02f81c714b0c41ce3a38380dd36a2/src/librustc_mir/transform/nrvo.rs#L76-L82">here</a>.</p>
<p>I don't think we really generate MIR where the return place is read; the first condition is more of a sanity check. To relax the second condition, you could do a full reaching definitions analysis to see what assignments to <code>_0</code> reach the return terminator. It's possible that this will catch some cases where the return place is assigned the same local across multiple branches, or there are intervening basic blocks between the assignment to the return place and the return terminator. I'm mildly skeptical that there's enough functions that satisfy those criteria to make a difference. I could be wrong though. In case several locals are assigned to <code>_0</code> along different control-flow paths, we could simply pick one to make the return place and eliminate one set of copies. However, doing this would have a lot of the same soundness pitfalls as a general version of MIR copy propagation.</p>
<p>As a result, time would probably be better spent working on general copy propagation, which <span class="user-mention" data-user-id="211727">@Jonas Schievink</span> is doing now. I believe it has proved more difficult than initially expected. Maybe due to the risk of source/dest aliasing in assignment statements which is why we generate so many copies in the first place? Perhaps they could tell you more. I would be really happy if we could get the general version merged and remove my "dumb" version. However, I've found that it's actually pretty tough to write sound MIR optimizations since MIR semantics are not yet well-defined, and I suspect that even once they're finished it will have to live behind a non-default <code>mir-opt-level</code> for some time.</p>
<p>It's also worth noting that I don't know the mechanism by which <code>check</code> builds were improved for <a href="https://github.com/rust-lang/rust/issues/72205">#72205</a>. The dumb NRVO pass occurs late enough in the optimization pipeline and the query-level perf improvements were sufficiently spread out that I am assuming it represented a real run-time performance improvement, although it would be nice to have library benchmarks that confirmed this. <span class="user-mention silent" data-user-id="211727">Jonas Schievink</span> did a perf run for an early version of their copy propagation pass and found no run-time improvements, but they didn't run it on the standard library, only <code>rustc</code>. This was surprising, since the standard library doesn't (to my knowledge) have much code that matches the canonical NRVO example: </p>
<div class="codehilite"><pre><span></span><code><span class="k">fn</span> <span class="nf">foo</span><span class="p">(</span><span class="n">init</span>: <span class="nc">fn</span><span class="p">(</span><span class="o">&amp;</span><span class="k">mut</span><span class="w"> </span><span class="p">[</span><span class="kt">u8</span><span class="p">;</span><span class="w"> </span><span class="mi">1024</span><span class="p">]))</span><span class="w"> </span>-&gt; <span class="p">[</span><span class="kt">u8</span><span class="p">;</span><span class="w"> </span><span class="mi">1024</span><span class="p">]</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">     </span><span class="kd">let</span><span class="w"> </span><span class="k">mut</span><span class="w"> </span><span class="n">buf</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">[</span><span class="mi">0</span><span class="p">;</span><span class="w"> </span><span class="mi">1024</span><span class="p">];</span><span class="w"></span>
<span class="w">     </span><span class="n">init</span><span class="p">(</span><span class="o">&amp;</span><span class="k">mut</span><span class="w"> </span><span class="n">buf</span><span class="p">);</span><span class="w"></span>
<span class="w">     </span><span class="n">buf</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>


<p>My hunch is that the standard library has many very short functions that are frequently monomorphized, and the savings from propagating into the return place can be significant when there are only a few locals/statements. Once again, I don't know exactly why<code>check</code> builds benefited from this. Perhaps this pushed some things below the inlining threshold? (this is quickly becoming my <span aria-label="shrug" class="emoji emoji-1f937" role="img" title="shrug">:shrug:</span> explanation for perf changes). Perhaps answering this question would give us a better idea of where to focus next? </p>
<p>Hopefully some of that information was useful to you. I'm not confident that the reaching definitions idea will be fruitful, but I'm available to answer questions if anyone wants to give it a shot. I probably won't get to it anytime soon. Partly this is because I don't have much free time but also because because I was explicitly advised not to do a simplified version of NRVO by a compiler team member. I was not happy about this, and I still don't know the reason behind it. It resulted in me sitting on <a href="https://github.com/rust-lang/rust/issues/72205">#72205</a> for about a month until it became clear that general copy propagation was still a ways off.</p>



<a name="203762879"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203762879" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203762879">(Jul 13 2020 at 19:55)</a>:</h4>
<blockquote>
<p>Once again, I don't know exactly whycheck builds benefited from this.</p>
</blockquote>
<p>Maybe less MIR -&gt; less time spent reading/writing metadata?</p>



<a name="203763159"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203763159" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203763159">(Jul 13 2020 at 19:57)</a>:</h4>
<blockquote>
<p>Once again, I don't know exactly whycheck builds benefited from this.</p>
</blockquote>
<p>Another possible explanation would be that this results in the CTFE engine doing less work for constants and promoted items which take a bigger portion of time in <code>check</code> builds vs non-<code>check</code> builds.</p>



<a name="203763553"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203763553" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203763553">(Jul 13 2020 at 20:00)</a>:</h4>
<p><span class="user-mention silent" data-user-id="133247">bjorn3</span> <a href="#narrow/stream/247081-t-compiler.2Fperformance/topic/NRVO/near/203762879">said</a>:</p>
<blockquote>
<blockquote>
<p>Once again, I don't know exactly whycheck builds benefited from this.</p>
</blockquote>
<p>Maybe less MIR -&gt; less time spent reading/writing metadata?</p>
</blockquote>
<p>If this  were true, I would have expected most of the savings to come from the <code>metadata</code> queries. Some do, but stuff like <code>mir_borrowck</code> is also consistently faster, which runs before the NRVO transform.</p>



<a name="203764019"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203764019" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203764019">(Jul 13 2020 at 20:04)</a>:</h4>
<blockquote>
<p>I believe it has proved more difficult than initially expected.</p>
</blockquote>
<p>Most issues were due to dumb oversights on my part, the current version should be sound (famous last words)</p>



<a name="203764504"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203764504" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203764504">(Jul 13 2020 at 20:08)</a>:</h4>
<p><span class="user-mention silent" data-user-id="125250">Wesley Wiser</span> <a href="#narrow/stream/247081-t-compiler.2Fperformance/topic/NRVO/near/203763159">said</a>:</p>
<blockquote>
<blockquote>
<p>Once again, I don't know exactly whycheck builds benefited from this.</p>
</blockquote>
<p>Another possible explanation would be that this results in the CTFE engine doing less work for constants and promoted items which take a bigger portion of time in <code>check</code> builds vs non-<code>check</code> builds.**</p>
</blockquote>
<p>I think this is plausible, but I'm not sold given that the speedup wasn't concentrated in one particular query (<code>mir_optimized</code> for const propagation and <code>const_eval_raw</code> are the obvious candidates). Savings on <code>check</code> builds were 0.5%-1% of total instructions, which seems a bit high, and the const-eval heavy benchmarks weren't affected any more than the others.</p>



<a name="203766565"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203766565" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203766565">(Jul 13 2020 at 20:27)</a>:</h4>
<p><span class="user-mention" data-user-id="211727">@Jonas Schievink</span> I'm following <a href="https://github.com/rust-lang/rust/issues/72632">#72632</a>. I wonder if <span class="user-mention" data-user-id="120989">@njn</span> has seen the latest perf results in <a href="https://github.com/rust-lang/rust/issues/72635">#72635</a>? They're pretty exciting once you look past the pathological cases.</p>



<a name="203780385"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203780385" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203780385">(Jul 13 2020 at 22:42)</a>:</h4>
<p>Those results seem very mixed...</p>



<a name="203781017"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203781017" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203781017">(Jul 13 2020 at 22:49)</a>:</h4>
<p><span class="user-mention" data-user-id="118594">@ecstatic-morse</span> Is there an easy way to turn off NRVO? E.g. a command line option, or by changing a constant in the code, or commenting out a line? I could do a Cachegrind diff with NRVO on and off, see what I find. (Other people could also do that...)</p>



<a name="203781080"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203781080" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203781080">(Jul 13 2020 at 22:50)</a>:</h4>
<p>Maybe I just change <code>local_eligible_for_nrvo</code> to always return <code>None</code>?</p>



<a name="203781129"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203781129" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203781129">(Jul 13 2020 at 22:51)</a>:</h4>
<p>Although that still runs the pass...</p>



<a name="203781432"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203781432" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203781432">(Jul 13 2020 at 22:55)</a>:</h4>
<p>There's mir-opt-level=0, but to isolate it just return early from <code>run_pass</code></p>



<a name="203781676"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203781676" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203781676">(Jul 13 2020 at 22:58)</a>:</h4>
<p>You need to look at the query breakdown. It's a big speedup except when <code>optimized_mir</code> is 100x slower.</p>



<a name="203782805"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203782805" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203782805">(Jul 13 2020 at 23:15)</a>:</h4>
<p>Are you talking about dumb NRVO or general copy propagation?</p>



<a name="203783480"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203783480" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203783480">(Jul 13 2020 at 23:26)</a>:</h4>
<p>The ones for Jonas's PR general version</p>



<a name="203783553"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203783553" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203783553">(Jul 13 2020 at 23:27)</a>:</h4>
<p>Ideas for how to make it less than 100x slower are appreciated :)</p>



<a name="203783737"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203783737" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203783737">(Jul 13 2020 at 23:31)</a>:</h4>
<p>are you getting into "me 2 years ago" territory :P?</p>



<a name="203783747"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203783747" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203783747">(Jul 13 2020 at 23:31)</a>:</h4>
<p>because I had some ideas on how to make the conflict matrix computation much cheaper</p>



<a name="203783762"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203783762" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203783762">(Jul 13 2020 at 23:31)</a>:</h4>
<p>well, maybe not the analysis leading up to it, but the quadratic stuff</p>



<a name="203783876"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203783876" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203783876">(Jul 13 2020 at 23:33)</a>:</h4>
<p>(compute a "best-case" set of optimizations, as in locals to unify, and union-find them into disjoint groups, before doing any work, so that you never consider interactions between those groups - as conflicts are non-transitive, that should be enough I believe)</p>



<a name="203783932"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203783932" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203783932">(Jul 13 2020 at 23:34)</a>:</h4>
<p>Don't nerd-snipe me again it's 1:30 am :D</p>



<a name="203783942"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203783942" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203783942">(Jul 13 2020 at 23:34)</a>:</h4>
<p>02:34am here</p>



<a name="203784013"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203784013" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203784013">(Jul 13 2020 at 23:35)</a>:</h4>
<p>hmm, so you'd do union-find on the to-be-merged locals <em>first</em>? interesting</p>



<a name="203784015"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203784015" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203784015">(Jul 13 2020 at 23:35)</a>:</h4>
<p>also, you can completely ignore locals you can decide early to not optimize assignments from/into</p>



<a name="203784067"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203784067" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203784067">(Jul 13 2020 at 23:36)</a>:</h4>
<p>since there's just nothing they contribute to any analysis, they're "scenery"</p>



<a name="203784086"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203784086" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203784086">(Jul 13 2020 at 23:36)</a>:</h4>
<p>like this? <a href="https://github.com/rust-lang/rust/blob/b7600237ce3b0121871cc7fb39f6c685410bbd8b/src/librustc_mir/transform/dest_prop.rs#L141">https://github.com/rust-lang/rust/blob/b7600237ce3b0121871cc7fb39f6c685410bbd8b/src/librustc_mir/transform/dest_prop.rs#L141</a></p>



<a name="203784105"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203784105" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203784105">(Jul 13 2020 at 23:37)</a>:</h4>
<p>oh heh nice</p>



<a name="203784132"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203784132" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203784132">(Jul 13 2020 at 23:37)</a>:</h4>
<p>yeah then split them into groups where you care about conflicts within groups, but would never unify locals between groups</p>



<a name="203784211"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203784211" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203784211">(Jul 13 2020 at 23:38)</a>:</h4>
<p>all of your matrix-like stuff should now become several disjoint smaller matrices (I guess they're sparse but eh you can deal with that)</p>



<a name="203784223"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203784223" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203784223">(Jul 13 2020 at 23:38)</a>:</h4>
<p>btw I made some types back then for sparse matrices, which <span class="user-mention" data-user-id="120989">@njn</span> later removed, I think?</p>



<a name="203784243"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203784243" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203784243">(Jul 13 2020 at 23:39)</a>:</h4>
<p><a href="https://doc.rust-lang.org/nightly/nightly-rustc/rustc_index/bit_set/struct.SparseBitMatrix.html">https://doc.rust-lang.org/nightly/nightly-rustc/rustc_index/bit_set/struct.SparseBitMatrix.html</a></p>



<a name="203784253"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203784253" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203784253">(Jul 13 2020 at 23:39)</a>:</h4>
<p>they were much faster because I could skip entire stretches of entries that were all empty</p>



<a name="203784255"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203784255" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203784255">(Jul 13 2020 at 23:39)</a>:</h4>
<p>huh</p>



<a name="203784283"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203784283" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203784283">(Jul 13 2020 at 23:39)</a>:</h4>
<p>that's not what I had (I flattened it into a sparse bitset) but it does look useful</p>



<a name="203784285"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203784285" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203784285">(Jul 13 2020 at 23:39)</a>:</h4>
<p>mir borrowck uses it</p>



<a name="203784338"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203784338" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203784338">(Jul 13 2020 at 23:40)</a>:</h4>
<p>oh this is not a sparse bit set :| <a href="https://doc.rust-lang.org/nightly/nightly-rustc/rustc_index/bit_set/struct.SparseBitSet.html">https://doc.rust-lang.org/nightly/nightly-rustc/rustc_index/bit_set/struct.SparseBitSet.html</a></p>



<a name="203784348"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203784348" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203784348">(Jul 13 2020 at 23:40)</a>:</h4>
<p>this is a <em>small</em> bit set</p>



<a name="203784349"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203784349" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203784349">(Jul 13 2020 at 23:40)</a>:</h4>
<p>don't tell me it got added, removed, and reimplemented :D</p>



<a name="203784357"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203784357" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203784357">(Jul 13 2020 at 23:40)</a>:</h4>
<p>yes, and reimplemented in a way which is less useful at my scale</p>



<a name="203784361"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203784361" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203784361">(Jul 13 2020 at 23:40)</a>:</h4>
<p>but I'd need benchmarking to prove it</p>



<a name="203784390"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203784390" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203784390">(Jul 13 2020 at 23:41)</a>:</h4>
<p>oh yeah that's not sparse at all</p>



<a name="203784397"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203784397" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203784397">(Jul 13 2020 at 23:41)</a>:</h4>
<blockquote>
<p>although <code>SmallVec</code> can spill its elements to the heap, that never happens within this type because of the <code>SPARSE_MAX</code> limit.</p>
</blockquote>



<a name="203784403"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203784403" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203784403">(Jul 13 2020 at 23:41)</a>:</h4>
<p>why not use an <code>ArrayVec</code>? that's what it's for</p>



<a name="203784485"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203784485" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203784485">(Jul 13 2020 at 23:42)</a>:</h4>
<p><span class="user-mention" data-user-id="211727">@Jonas Schievink</span> my approach is basically a map from "chunk address" to "chunk bits" which can be any number of them (<code>u128</code> if you feel generous, but it's probably slower that way :P), and I was hoping that <code>BTreeMap</code> would be flat enough to make things go extremely well</p>



<a name="203784498"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203784498" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203784498">(Jul 13 2020 at 23:42)</a>:</h4>
<p>but <span class="user-mention" data-user-id="120989">@njn</span> found that btrees actually are slower than I thought, so for other usecases they were worse :(</p>



<a name="203784516"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203784516" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203784516">(Jul 13 2020 at 23:43)</a>:</h4>
<p>anyway you can spend years tuning foo-trees and tries and all sorts of data structures</p>



<a name="203784527"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203784527" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203784527">(Jul 13 2020 at 23:43)</a>:</h4>
<p>in the end the important bit is to skip most of the work :P</p>



<a name="203784596"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203784596" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203784596">(Jul 13 2020 at 23:44)</a>:</h4>
<p><span class="user-mention" data-user-id="211727">@Jonas Schievink</span> anyway I'd suggest computing disjoint groups, asserting that you never optimize locals between groups, only within (just to validate that the reasoning makes sense), and then gata data about the full set of locals, how many groups it's split into, and how big they are</p>



<a name="203784600"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203784600" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203784600">(Jul 13 2020 at 23:44)</a>:</h4>
<p>and you can do it on <code>inflate</code> if you'd like :P</p>



<a name="203784601"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203784601" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203784601">(Jul 13 2020 at 23:44)</a>:</h4>
<p>yeah I'm not too worried about micro-optimizing data structures yet, my main concern is performance in O-notation</p>



<a name="203784637"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203784637" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203784637">(Jul 13 2020 at 23:45)</a>:</h4>
<p><a href="https://blog.mozilla.org/nnethercote/2018/11/06/how-to-speed-up-the-rust-compiler-in-2018-nll-edition/">https://blog.mozilla.org/nnethercote/2018/11/06/how-to-speed-up-the-rust-compiler-in-2018-nll-edition/</a> is relevant here, see the entries for <a href="https://github.com/rust-lang/rust/issues/52250">#52250</a> and <a href="https://github.com/rust-lang/rust/issues/53383">#53383</a></p>



<a name="203784638"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203784638" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203784638">(Jul 13 2020 at 23:45)</a>:</h4>
<p>the reason I thought this would help is that <code>inflate</code> (well, the old copy on <a href="http://perf.rust-lang.org">perf.rust-lang.org</a>, I wish it was named <code>inflate-bloated</code> or something) has one function with <em>a lot</em> of macro-generated code, that would normally be separate functions</p>



<a name="203784643"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203784643" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203784643">(Jul 13 2020 at 23:45)</a>:</h4>
<p>oh I have another nemesis already, <a href="https://raw.githubusercontent.com/rust-lang/rustc-perf/master/collector/benchmarks/tuple-stress/src/main.rs">tuple-stress</a></p>



<a name="203784697"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203784697" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203784697">(Jul 13 2020 at 23:46)</a>:</h4>
<p><span class="user-mention" data-user-id="211727">@Jonas Schievink</span> I recommend printing out the contents of your large structures in some way to get a sense of how the data is distributed, to see if there are any patterns you can exploit</p>



<a name="203784698"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203784698" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203784698">(Jul 13 2020 at 23:46)</a>:</h4>
<p>and so splitting locals into disjoint groups would make the optimization behave more as if it was ran on separate functions</p>



<a name="203784700"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203784700" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203784700">(Jul 13 2020 at 23:46)</a>:</h4>
<blockquote>
<p>This reduces the runtime of Check Nll builds of inflate by 32%</p>
</blockquote>
<p>wow</p>



<a name="203784724"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203784724" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203784724">(Jul 13 2020 at 23:46)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/issues/53383">#53383</a> was an example where doing that gave big improvements</p>



<a name="203784738"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203784738" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203784738">(Jul 13 2020 at 23:46)</a>:</h4>
<p><span class="user-mention" data-user-id="211727">@Jonas Schievink</span> yeah but we don't take stress tests seriously for this sort of situation :P</p>



<a name="203784759"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203784759" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203784759">(Jul 13 2020 at 23:47)</a>:</h4>
<p><code>inflate</code> is the big daddy of "huge macro generated function that actually does something useful"</p>



<a name="203784760"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203784760" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203784760">(Jul 13 2020 at 23:47)</a>:</h4>
<p>Oh, <a href="https://github.com/rust-lang/rust/issues/54318">#54318</a> was also relevant in that post</p>



<a name="203784825"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203784825" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203784825">(Jul 13 2020 at 23:48)</a>:</h4>
<p>I had a bigger one back when I started with Rust and quadratic behavior in borrowck or w/e led to a 700TB allocation attempt</p>



<a name="203784840"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203784840" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203784840">(Jul 13 2020 at 23:48)</a>:</h4>
<p>that's kind of why I got into optimizing stuff, really. kind of sad that I've never gone back to stuff like that</p>



<a name="203784843"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203784843" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203784843">(Jul 13 2020 at 23:48)</a>:</h4>
<p>IMO stress tests help with this because they show very clearly what's wrong</p>



<a name="203784854"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203784854" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203784854">(Jul 13 2020 at 23:48)</a>:</h4>
<p>sure but they can also be unrealistic sometimes</p>



<a name="203784865"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203784865" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203784865">(Jul 13 2020 at 23:49)</a>:</h4>
<p>also I'm cheating because I wrote <code>inflate</code> so I know what it does</p>



<a name="203784884"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203784884" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203784884">(Jul 13 2020 at 23:49)</a>:</h4>
<p>and specifically, how it stresses the compiler: lots of largely-independent chunks of almost-identical code</p>



<a name="203784910"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203784910" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203784910">(Jul 13 2020 at 23:49)</a>:</h4>
<p>anything worse than linear in the number of locals, or blocks, will have a hard time, even if you split it into separate functions, it would be fine</p>



<a name="203784984"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203784984" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203784984">(Jul 13 2020 at 23:50)</a>:</h4>
<p><span class="user-mention silent" data-user-id="119009">eddyb</span> <a href="#narrow/stream/247081-t-compiler.2Fperformance/topic/NRVO/near/203784596">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="211727">Jonas Schievink</span> anyway I'd suggest computing disjoint groups, asserting that you never optimize locals between groups, only within (just to validate that the reasoning makes sense), and then gata data about the full set of locals, how many groups it's split into, and how big they are</p>
</blockquote>
<p>anyway this remains my suggestion for how to proceed</p>



<a name="203784999"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203784999" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203784999">(Jul 13 2020 at 23:50)</a>:</h4>
<p>yeah, will look into that at some point</p>



<a name="203785006"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203785006" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203785006">(Jul 13 2020 at 23:50)</a>:</h4>
<p>would be great to get the current state merged though</p>



<a name="203785015"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203785015" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203785015">(Jul 13 2020 at 23:51)</a>:</h4>
<p>and frankly besides "ask around for graph coloring resources", it's the only idea I've had in years to make progress on it</p>



<a name="203785029"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203785029" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203785029">(Jul 13 2020 at 23:51)</a>:</h4>
<p><span class="user-mention" data-user-id="211727">@Jonas Schievink</span> how bad is it on <code>inflate</code>?</p>



<a name="203785077"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203785077" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203785077">(Jul 13 2020 at 23:51)</a>:</h4>
<p>or <code>clap-rs</code>, I think that was the other macro-generated bloat benchmark</p>



<a name="203785161"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203785161" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203785161">(Jul 13 2020 at 23:52)</a>:</h4>
<p>inflate looks like 3% slower</p>



<a name="203785165"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203785165" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203785165">(Jul 13 2020 at 23:52)</a>:</h4>
<p>clap is faster</p>



<a name="203785176"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203785176" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203785176">(Jul 13 2020 at 23:52)</a>:</h4>
<p><span class="user-mention" data-user-id="120989">@njn</span> btw did you see my comment above about using <code>ArrayVec</code> instead of <code>SmallVec</code> when you never intend to do heap allocations?</p>



<a name="203785180"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203785180" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203785180">(Jul 13 2020 at 23:52)</a>:</h4>
<p>not sure if it hits the bailout limit though</p>



<a name="203785191"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203785191" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203785191">(Jul 13 2020 at 23:53)</a>:</h4>
<p>3% is suspiciously little</p>



<a name="203785221"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203785221" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203785221">(Jul 13 2020 at 23:53)</a>:</h4>
<p>IMO you should try with that limit disabled</p>



<a name="203785294"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203785294" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203785294">(Jul 13 2020 at 23:54)</a>:</h4>
<p>I'd be impressed with below 10x, but I don't know the details too well (so much to catch up with <em>sigh</em>)</p>



<a name="203785325"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203785325" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203785325">(Jul 13 2020 at 23:55)</a>:</h4>
<p>(900% aka 9x might've been my best, but maybe I'm misremembering)</p>



<a name="203785606"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203785606" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203785606">(Jul 13 2020 at 23:58)</a>:</h4>
<p>hmm, maybe conflicts can be computed incrementally too</p>



<a name="203785662"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203785662" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203785662">(Jul 13 2020 at 23:59)</a>:</h4>
<p>eh, something to look into later in any case. I want to get <em>something</em> in rustc first.</p>



<a name="203785826"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203785826" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203785826">(Jul 14 2020 at 00:01)</a>:</h4>
<p><span class="user-mention" data-user-id="211727">@Jonas Schievink</span> can you get me un-bailout-limited numbers first?</p>



<a name="203785859"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203785859" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203785859">(Jul 14 2020 at 00:02)</a>:</h4>
<p>I'd like to understand what's happening, if it truly is 3% on the big function in <code>inflate</code></p>



<a name="203785955"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203785955" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203785955">(Jul 14 2020 at 00:03)</a>:</h4>
<p>maybe tomorrow, but I don't really trust this machine to do benchmarks</p>



<a name="203786777"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203786777" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203786777">(Jul 14 2020 at 00:16)</a>:</h4>
<p><span class="user-mention" data-user-id="119009">@eddyb</span> oh, interesting about <code>ArrayVec</code>, I'll take a look</p>



<a name="203786850"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203786850" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203786850">(Jul 14 2020 at 00:17)</a>:</h4>
<p>@eddyb: you mean <a href="https://docs.rs/arrayvec/0.5.1/arrayvec/">https://docs.rs/arrayvec/0.5.1/arrayvec/</a>, right?</p>



<a name="203787346"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203787346" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203787346">(Jul 14 2020 at 00:27)</a>:</h4>
<p><span class="user-mention" data-user-id="120989">@njn</span> yeah. looks like we already have it in <code>Cargo.lock</code>, but only as an indirect dependency</p>



<a name="203787393"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203787393" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203787393">(Jul 14 2020 at 00:28)</a>:</h4>
<p>(not sure if an audit is in order of all the <code>SmallVec</code> uses)</p>



<a name="203787398"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203787398" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203787398">(Jul 14 2020 at 00:28)</a>:</h4>
<p>heh:</p>
<div class="codehilite"><pre><span></span><code>$ rg ArrayVec
RELEASES.md
4521:* [Add `ArrayVec` and `AccumulateVec` to reduce heap allocations
</code></pre></div>



<a name="203787692"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203787692" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203787692">(Jul 14 2020 at 00:34)</a>:</h4>
<p>I wonder if it'll actually effect perf. <code>SparseBitSet</code> is hot for some benchmarks.</p>



<a name="203787695"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203787695" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203787695">(Jul 14 2020 at 00:34)</a>:</h4>
<p>/me will test</p>



<a name="203890754"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203890754" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203890754">(Jul 14 2020 at 21:27)</a>:</h4>
<p>I cannot for the life of me figure out how to actually use rustc-perf, so no data I guess</p>



<a name="203891029"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203891029" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203891029">(Jul 14 2020 at 21:30)</a>:</h4>
<p><span class="user-mention" data-user-id="211727">@Jonas Schievink</span> that was me for the longest time. or do you mean the official instance?</p>



<a name="203891080"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203891080" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203891080">(Jul 14 2020 at 21:31)</a>:</h4>
<p>nah that's easy, but I don't want to occupy the server for everything I want to measure (and produce notification spam)</p>



<a name="203891081"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203891081" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203891081">(Jul 14 2020 at 21:31)</a>:</h4>
<p>like I'd expect pushing a commit that takes the limits off, a <code>@bors try @rust-timer queue</code>, and nothing more</p>



<a name="203891129"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203891129" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203891129">(Jul 14 2020 at 21:31)</a>:</h4>
<p>I'd have to rebase then</p>



<a name="203891134"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203891134" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203891134">(Jul 14 2020 at 21:31)</a>:</h4>
<p><span class="user-mention" data-user-id="211727">@Jonas Schievink</span> or you can just be shameless</p>



<a name="203891180"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203891180" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203891180">(Jul 14 2020 at 21:32)</a>:</h4>
<p>oh huh</p>



<a name="203891880"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203891880" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203891880">(Jul 14 2020 at 21:40)</a>:</h4>
<p>hmm, looks like inflate only gets slower by a few percent when disabling the limit (unless I'm measuring wrongly)</p>



<a name="203892404"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203892404" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203892404">(Jul 14 2020 at 21:46)</a>:</h4>
<p><span class="user-mention" data-user-id="211727">@Jonas Schievink</span> can you log the sizes (in locals and BBs) of the functions the optimization runs on? maybe time them using the <code>-Z time-passes</code> functionality or w/e</p>



<a name="203892471"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203892471" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203892471">(Jul 14 2020 at 21:46)</a>:</h4>
<p>(assuming there's no way to use <code>-Z self-profile</code> for this currently, presumably we want to integrate MIR passes as non-query profiled functions)</p>



<a name="203892497"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203892497" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203892497">(Jul 14 2020 at 21:46)</a>:</h4>
<p><del>@<strong>Joshua Nelson</strong></del> <span class="user-mention" data-user-id="211727">@Jonas Schievink</span> you should see a function that is orders of magnitude worse than the orders (I forget the exact numbers)</p>



<a name="203892544"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203892544" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203892544">(Jul 14 2020 at 21:47)</a>:</h4>
<p>(you meant to tag <span class="user-mention silent" data-user-id="211727">Jonas Schievink</span> I think)</p>



<a name="203892545"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203892545" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203892545">(Jul 14 2020 at 21:47)</a>:</h4>
<p>you might be getting lucky with the local filtering, even when it doesn't remove quadratic behavior, which makes me worried  that someone out there was more optimizable bloat than <code>inflate</code></p>



<a name="203892563"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203892563" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203892563">(Jul 14 2020 at 21:47)</a>:</h4>
<p>argh I didn't look and the Jo fit</p>



<a name="203893928"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203893928" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203893928">(Jul 14 2020 at 22:02)</a>:</h4>
<p><code>DefId(0:114 ~ inflate[4216]::{{impl}}[3]::next_state[0]): 10858 locals (4741 relevant), 5555 blocks</code></p>
<p><em>what</em> have you done <span class="user-mention" data-user-id="119009">@eddyb</span>?! :D</p>



<a name="203893944"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203893944" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203893944">(Jul 14 2020 at 22:02)</a>:</h4>
<p>wow that feels tiny</p>



<a name="203893953"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203893953" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203893953">(Jul 14 2020 at 22:02)</a>:</h4>
<p>I would've expected like maybe an order of magnitude more</p>



<a name="203893964"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203893964" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203893964">(Jul 14 2020 at 22:02)</a>:</h4>
<p>it optimizes a bunch of stuff in that monster of a function but it doesn't impact compile times much</p>



<a name="203893965"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203893965" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203893965">(Jul 14 2020 at 22:02)</a>:</h4>
<p>any chance it's an unbloated version of inflate?</p>



<a name="203893972"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203893972" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203893972">(Jul 14 2020 at 22:03)</a>:</h4>
<p>don't tell me the benchmark is broken</p>



<a name="203893989"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203893989" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203893989">(Jul 14 2020 at 22:03)</a>:</h4>
<p>link me to a copy of the code :P</p>



<a name="203893999"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203893999" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203893999">(Jul 14 2020 at 22:03)</a>:</h4>
<p>it's just called "inflate" in <code>collector/benchmarks</code></p>



<a name="203894004"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203894004" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203894004">(Jul 14 2020 at 22:03)</a>:</h4>
<p>sure, but</p>



<a name="203894007"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203894007" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203894007">(Jul 14 2020 at 22:03)</a>:</h4>
<p>I want to make sure we are looking at the same version</p>



<a name="203894032"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203894032" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203894032">(Jul 14 2020 at 22:03)</a>:</h4>
<p><code>3294414276f297c99d061fcc7fac44690fcde279</code></p>



<a name="203894094"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203894094" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203894094">(Jul 14 2020 at 22:04)</a>:</h4>
<p>so <a href="https://github.com/rust-lang/rustc-perf/tree/3294414276f297c99d061fcc7fac44690fcde279/collector/benchmarks/inflate">https://github.com/rust-lang/rustc-perf/tree/3294414276f297c99d061fcc7fac44690fcde279/collector/benchmarks/inflate</a></p>



<a name="203894099"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203894099" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203894099">(Jul 14 2020 at 22:04)</a>:</h4>
<p><a href="https://github.com/rust-lang/rustc-perf/commit/3294414276f297c99d061fcc7fac44690fcde279">https://github.com/rust-lang/rustc-perf/commit/3294414276f297c99d061fcc7fac44690fcde279</a></p>



<a name="203894116"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203894116" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203894116">(Jul 14 2020 at 22:04)</a>:</h4>
<p>yeah?</p>



<a name="203894152"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203894152" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203894152">(Jul 14 2020 at 22:04)</a>:</h4>
<p>yeah it's the bloated one <a href="https://github.com/rust-lang/rustc-perf/blob/3294414276f297c99d061fcc7fac44690fcde279/collector/benchmarks/inflate/src/lib.rs#L672-L700">https://github.com/rust-lang/rustc-perf/blob/3294414276f297c99d061fcc7fac44690fcde279/collector/benchmarks/inflate/src/lib.rs#L672-L700</a></p>



<a name="203894165"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203894165" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203894165">(Jul 14 2020 at 22:04)</a>:</h4>
<p>(that's the bit of code that replaced all the macro generated code. it used to be slower but at some point it became faster)</p>



<a name="203894188"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203894188" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203894188">(Jul 14 2020 at 22:05)</a>:</h4>
<p>I only wrote it down for testing, when I first wrote all this lol</p>



<a name="203894230"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203894230" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203894230">(Jul 14 2020 at 22:05)</a>:</h4>
<p>this is one of the more egregious macros in all this <a href="https://github.com/rust-lang/rustc-perf/blob/3294414276f297c99d061fcc7fac44690fcde279/collector/benchmarks/inflate/src/lib.rs#L722">https://github.com/rust-lang/rustc-perf/blob/3294414276f297c99d061fcc7fac44690fcde279/collector/benchmarks/inflate/src/lib.rs#L722</a></p>



<a name="203894278"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203894278" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203894278">(Jul 14 2020 at 22:06)</a>:</h4>
<p>I see</p>



<a name="203894464"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203894464" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203894464">(Jul 14 2020 at 22:08)</a>:</h4>
<p>But that function I found clearly looks like <code>next_state</code> (although I'm not printing the right thing, the same defid text shows up ~a dozen times due to promoteds)</p>



<a name="203894499"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203894499" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203894499">(Jul 14 2020 at 22:09)</a>:</h4>
<p>then why is it so much smaller than you remember, and why is dest prop not slow? the limit would kick in for way smaller functions normally</p>



<a name="203894581"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203894581" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203894581">(Jul 14 2020 at 22:10)</a>:</h4>
<p>not that I'm complaining though</p>



<a name="203894610"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203894610" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203894610">(Jul 14 2020 at 22:10)</a>:</h4>
<p><span class="user-mention" data-user-id="211727">@Jonas Schievink</span> how many of those locals are you actually optimizing?</p>



<a name="203894619"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203894619" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203894619">(Jul 14 2020 at 22:10)</a>:</h4>
<p>oh I see</p>



<a name="203894644"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203894644" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203894644">(Jul 14 2020 at 22:10)</a>:</h4>
<p>50% doesn't feel small enough to be relevant</p>



<a name="203894649"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203894649" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203894649">(Jul 14 2020 at 22:10)</a>:</h4>
<p><span class="user-mention" data-user-id="211727">@Jonas Schievink</span> and there are matrices involved?</p>



<a name="203894663"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203894663" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203894663">(Jul 14 2020 at 22:11)</a>:</h4>
<p>matrices and unification tables</p>



<a name="203894711"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203894711" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203894711">(Jul 14 2020 at 22:11)</a>:</h4>
<p>not sure how many replacements remain, I only log the entire map not its length</p>



<a name="203894818"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203894818" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203894818">(Jul 14 2020 at 22:13)</a>:</h4>
<p>sure, in my case the cost was definitely on the "domain size" of the matrices involved and whatnot. I managed to optimize it by using a spare bit set/matrix API that exposed "chunked iteration" so that I wouldn't do work per bit, but rather in chunks, and I wouldn't get the missing chunks at all</p>



<a name="203894830"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203894830" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203894830">(Jul 14 2020 at 22:13)</a>:</h4>
<p>anyway sounds like your approach is less costly. congrats etc.</p>



<a name="203894846"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203894846" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203894846">(Jul 14 2020 at 22:13)</a>:</h4>
<p>lol</p>



<a name="203894896"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203894896" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203894896">(Jul 14 2020 at 22:14)</a>:</h4>
<p>now if it only was <em>always</em> cheap to run</p>



<a name="203894921"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203894921" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203894921">(Jul 14 2020 at 22:14)</a>:</h4>
<p>but for real, this only happened because you landed the prerequisites and nerd-sniped me</p>



<a name="203895765"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203895765" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203895765">(Jul 14 2020 at 22:25)</a>:</h4>
<p><span class="user-mention" data-user-id="211727">@Jonas Schievink</span> low-key wondering if we'll find out down the line it's only faster because it doesn't check all the preconditions but also kind of choosing to ignore that because I want to sleep at night</p>



<a name="203895941"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203895941" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203895941">(Jul 14 2020 at 22:27)</a>:</h4>
<p>there isn't much it <em>isn't</em> checking at this point</p>



<a name="203896032"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203896032" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203896032">(Jul 14 2020 at 22:28)</a>:</h4>
<p>but yeah, that's why I'd love to have a better way to write tests for this sort of stuff</p>



<a name="203896086"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203896086" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203896086">(Jul 14 2020 at 22:28)</a>:</h4>
<p>would be much easier if I could just write down a few lines of MIR and record the diff it produces on it</p>



<a name="203896319"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203896319" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203896319">(Jul 14 2020 at 22:31)</a>:</h4>
<p><span class="user-mention" data-user-id="211727">@Jonas Schievink</span> btw have you tried to bootstrap with it fully enabled, no limits applied?</p>



<a name="203896359"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203896359" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203896359">(Jul 14 2020 at 22:31)</a>:</h4>
<p>that's one of the cheapest tests, per coverage offered, IME</p>



<a name="203896444"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203896444" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203896444">(Jul 14 2020 at 22:32)</a>:</h4>
<p>I kept finding exciting new edge cases that way, and even had to rethink how I was computing conflcits at one point</p>



<a name="203896874"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203896874" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203896874">(Jul 14 2020 at 22:38)</a>:</h4>
<p>I feel like I did do that a couple of times, including running the full test suite</p>



<a name="203896890"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203896890" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203896890">(Jul 14 2020 at 22:38)</a>:</h4>
<p>and the limit doesn't kick in very often on usual code</p>



<a name="203896951"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203896951" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203896951">(Jul 14 2020 at 22:39)</a>:</h4>
<p>eh you don't want to trust it, especially as you want unusual code if possible :P</p>



<a name="203897030"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203897030" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203897030">(Jul 14 2020 at 22:40)</a>:</h4>
<p><span class="user-mention" data-user-id="211727">@Jonas Schievink</span> full test suite with a compiler that was NRVO-optimized throughout, right?</p>



<a name="203897052"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203897052" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203897052">(Jul 14 2020 at 22:40)</a>:</h4>
<p>should be, yeah</p>



<a name="203897066"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203897066" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203897066">(Jul 14 2020 at 22:41)</a>:</h4>
<p>(I'm doing it again)</p>



<a name="203897263"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203897263" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203897263">(Jul 14 2020 at 22:43)</a>:</h4>
<p>ugh, can't bless codegen tests</p>



<a name="203897281"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203897281" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203897281">(Jul 14 2020 at 22:43)</a>:</h4>
<p>anyways bootstrap works and all but one UI tests pass</p>



<a name="203897333"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203897333" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203897333">(Jul 14 2020 at 22:44)</a>:</h4>
<p>the single failing one only changes a span due to the optimization</p>



<a name="203897366"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203897366" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203897366">(Jul 14 2020 at 22:44)</a>:</h4>
<p>like a warning from codegen?</p>



<a name="203897524"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203897524" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203897524">(Jul 14 2020 at 22:46)</a>:</h4>
<div class="codehilite"><pre><span></span><code><span class="gd">--- a/src/test/ui/lint/issue-69485-var-size-diffs-too-large.stderr</span>
<span class="gi">+++ b/src/test/ui/lint/issue-69485-var-size-diffs-too-large.stderr</span>
<span class="gu">@@ -1,8 +1,8 @@</span>
 error: the type `[u8; 18446744073709551615]` is too big for the current architecture
<span class="gd">-  --&gt; $DIR/issue-69485-var-size-diffs-too-large.rs:5:12</span>
<span class="gi">+  --&gt; $DIR/issue-69485-var-size-diffs-too-large.rs:5:5</span>
    |
 LL |     Bug::V([0; !0]);
<span class="gd">-   |            ^^^^^^^</span>
<span class="gi">+   |     ^^^^^^^^^^^^^^^</span>

 error: aborting due to previous error
</code></pre></div>



<a name="203897552"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203897552" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203897552">(Jul 14 2020 at 22:46)</a>:</h4>
<p>or an error from codegen :P</p>



<a name="203897561"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203897561" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203897561">(Jul 14 2020 at 22:47)</a>:</h4>
<p><span class="user-mention" data-user-id="211727">@Jonas Schievink</span> I have tried to make the <a href="https://github.com/rust-lang/rustc-perf/blob/master/collector/README.md">rustc-perf instructions</a> usable. Have you gone through them carefully? I'm happy to hear suggestions to make them clearer. Having capable people try and fail to use rustc-perf is a concern.</p>



<a name="203897590"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203897590" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203897590">(Jul 14 2020 at 22:47)</a>:</h4>
<p><span class="user-mention" data-user-id="120989">@njn</span> one thing that tripped me up is collector depends on <code>rustc-fake</code>, but that's not communicated to cargo</p>



<a name="203897597"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203897597" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203897597">(Jul 14 2020 at 22:47)</a>:</h4>
<p><span class="user-mention" data-user-id="120989">@njn</span> thanks, I think there might have been recent changes that made them go out of sync?</p>



<a name="203897651"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203897651" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203897651">(Jul 14 2020 at 22:48)</a>:</h4>
<p>so you need to explicitly use <code>cargo build --release</code>, <code>cargo run --bin collector</code> will not work (and will silently use old versions of rustc-fake if they exist)</p>



<a name="203897652"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203897652" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203897652">(Jul 14 2020 at 22:48)</a>:</h4>
<p>ie. it complains that I haven't passed <code>--rustdoc</code> but requested <code>Rustdoc</code> runs (I didn't)</p>



<a name="203897670"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203897670" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203897670">(Jul 14 2020 at 22:48)</a>:</h4>
<p>oh <span class="user-mention" data-user-id="116122">@simulacrum</span> made rustdoc optional but may not have caught everything</p>



<a name="203897682"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203897682" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203897682">(Jul 14 2020 at 22:48)</a>:</h4>
<p>also the ordering requirements of command line args is thoroughly confusing</p>



<a name="203897683"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203897683" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203897683">(Jul 14 2020 at 22:48)</a>:</h4>
<p>my fault, sorry</p>



<a name="203897764"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203897764" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203897764">(Jul 14 2020 at 22:49)</a>:</h4>
<p>The instructions got out of sync a couple of weeks ago but I think I fixed that. Did the rustdoc profiling changes land? I haven't updated since then.</p>



<a name="203897823"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203897823" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203897823">(Jul 14 2020 at 22:50)</a>:</h4>
<p>yes, just today</p>



<a name="203897827"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203897827" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203897827">(Jul 14 2020 at 22:50)</a>:</h4>
<p>but rustdoc was meant to be optional</p>



<a name="203897828"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203897828" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203897828">(Jul 14 2020 at 22:50)</a>:</h4>
<p>ok</p>



<a name="203897843"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203897843" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203897843">(Jul 14 2020 at 22:50)</a>:</h4>
<p>ah, then that part was just bad luck</p>



<a name="203897847"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203897847" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203897847">(Jul 14 2020 at 22:50)</a>:</h4>
<p>A big problem is that we don't have decent testing for rustc-perf</p>



<a name="203897873"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203897873" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203897873">(Jul 14 2020 at 22:51)</a>:</h4>
<p>the CI part gets executed frequently, but the local benchmarking/profiling stuff gets broken periodically</p>



<a name="203897875"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203897875" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203897875">(Jul 14 2020 at 22:51)</a>:</h4>
<p>:(</p>



<a name="203897895"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203897895" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203897895">(Jul 14 2020 at 22:51)</a>:</h4>
<p>We should fix that</p>



<a name="203897922"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203897922" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203897922">(Jul 14 2020 at 22:51)</a>:</h4>
<p><span class="user-mention" data-user-id="211727">@Jonas Schievink</span> <code>bench_local</code> works for me without --rustdoc, what command are you using?</p>



<a name="203898012"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203898012" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203898012">(Jul 14 2020 at 22:52)</a>:</h4>
<p><code>target/release/collector --db db --self-profile --filter inflate bench_local --runs Full,IncrFull,IncrPatched --rustc ../rust/build/x86_64-unknown-linux-gnu/stage1/bin/rustc --cargo (which cargo) dest-prop-limited</code></p>



<a name="203898029"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203898029" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203898029">(Jul 14 2020 at 22:52)</a>:</h4>
<p>The <code>--runs</code> was a failed attempt at making it not require rustdoc</p>



<a name="203898078"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203898078" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203898078">(Jul 14 2020 at 22:53)</a>:</h4>
<p>/me files <a href="https://github.com/rust-lang/rustc-perf/issues/681">https://github.com/rust-lang/rustc-perf/issues/681</a></p>



<a name="203898088"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203898088" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203898088">(Jul 14 2020 at 22:53)</a>:</h4>
<p>where do I get <code>summarize</code> from?</p>



<a name="203898141"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203898141" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203898141">(Jul 14 2020 at 22:54)</a>:</h4>
<p>install <a href="https://github.com/rust-lang/measureme">https://github.com/rust-lang/measureme</a></p>



<a name="203898172"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203898172" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203898172">(Jul 14 2020 at 22:54)</a>:</h4>
<p>(without --self-profile it works btw)</p>



<a name="203898174"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203898174" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203898174">(Jul 14 2020 at 22:54)</a>:</h4>
<p>(That should be better documented.)</p>



<a name="203898198"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203898198" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203898198">(Jul 14 2020 at 22:55)</a>:</h4>
<p>huh</p>



<a name="203898221"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203898221" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203898221">(Jul 14 2020 at 22:55)</a>:</h4>
<p><span class="user-mention" data-user-id="211727">@Jonas Schievink</span> what does the <code>dest-prop-limited</code> do?</p>



<a name="203898257"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203898257" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203898257">(Jul 14 2020 at 22:55)</a>:</h4>
<p>Just tried to set this:</p>
<blockquote>
<p>$ID is an identifier which will be used to identify the results in the collected data.</p>
</blockquote>



<a name="203898337"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203898337" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203898337">(Jul 14 2020 at 22:56)</a>:</h4>
<p>Ah, yep</p>



<a name="203898345"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203898345" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203898345">(Jul 14 2020 at 22:56)</a>:</h4>
<p>works for me with --self-profile too :/</p>



<a name="203898355"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203898355" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203898355">(Jul 14 2020 at 22:57)</a>:</h4>
<p>I have some bash functions that I use to run the commands, the arguments are different, so I'm not used to seeing the normal commands...</p>



<a name="203898363"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203898363" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203898363">(Jul 14 2020 at 22:57)</a>:</h4>
<p>oh wait I'm on an old master, sorry</p>



<a name="203898375"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203898375" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203898375">(Jul 14 2020 at 22:57)</a>:</h4>
<p>it works neither with nor without <code>--self-profile</code> for me :P</p>



<a name="203898414"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203898414" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203898414">(Jul 14 2020 at 22:57)</a>:</h4>
<p><span class="user-mention" data-user-id="211727">@Jonas Schievink</span> rustdoc is a build, not a run</p>



<a name="203898463"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203898463" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203898463">(Jul 14 2020 at 22:58)</a>:</h4>
<p>so as a workaround <code>--builds Check,Opt,Debug</code> should work</p>



<a name="203898506"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203898506" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203898506">(Jul 14 2020 at 22:58)</a>:</h4>
<p>that gets me a bit further</p>
<div class="codehilite"><pre><span></span><code>Benchmarking dest-prop-limited for triple x86_64-unknown-linux-gnu
1 benchmark remaining
Preparing inflate (with Debug)
thread &#39;main&#39; panicked at &#39;failed to obtain pkgid in &quot;/tmp/.tmpXTrBUp&quot;: expected success, got exit code: 1

stderr=error: error: Found argument &#39;--manifest-path&#39; which wasn&#39;t expected, or isn&#39;t valid in this context

USAGE:
    rustup [FLAGS] [+toolchain] &lt;SUBCOMMAND&gt;

For more information try --help



 stdout=&#39;, collector/src/bin/rustc-perf-collector/execute.rs:248:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
</code></pre></div>



<a name="203898569"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203898569" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203898569">(Jul 14 2020 at 22:59)</a>:</h4>
<p>these sorts of issues often pop up when using rustc-perf, so I avoid using it</p>



<a name="203898662"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203898662" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203898662">(Jul 14 2020 at 23:00)</a>:</h4>
<p>I think you might be missing a $ on your which cargo?</p>



<a name="203898713"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203898713" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203898713">(Jul 14 2020 at 23:01)</a>:</h4>
<p>it works fine for me with an explicit <code>--builds</code> <span aria-label="confused" class="emoji emoji-1f615" role="img" title="confused">:confused:</span></p>



<a name="203898733"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203898733" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203898733">(Jul 14 2020 at 23:01)</a>:</h4>
<p>Would be helpful to get the exact command you are running and the output</p>



<a name="203898748"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203898748" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203898748">(Jul 14 2020 at 23:01)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116122">simulacrum</span> <a href="#narrow/stream/247081-t-compiler.2Fperformance/topic/NRVO/near/203898662">said</a>:</p>
<blockquote>
<p>I think you might be missing a $ on your which cargo?</p>
</blockquote>
<p>No, but it looks like passing the rustup wrapper causes that issue</p>



<a name="203898760"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203898760" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203898760">(Jul 14 2020 at 23:01)</a>:</h4>
<p>If I use <code>rustup which cargo</code> and pass that path it works</p>



<a name="203898789"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203898789" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203898789">(Jul 14 2020 at 23:01)</a>:</h4>
<p>(fish uses <code>(cmd)</code> syntax instead of <code>$(cmd)</code>)</p>



<a name="203898935"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203898935" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203898935">(Jul 14 2020 at 23:03)</a>:</h4>
<p>(working on a fix)</p>



<a name="203899145"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203899145" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203899145">(Jul 14 2020 at 23:06)</a>:</h4>
<p><a href="https://github.com/rust-lang/rustc-perf/pull/682">https://github.com/rust-lang/rustc-perf/pull/682</a></p>



<a name="203899154"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203899154" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203899154">(Jul 14 2020 at 23:06)</a>:</h4>
<p>thanks!</p>



<a name="203899192"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203899192" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203899192">(Jul 14 2020 at 23:07)</a>:</h4>
<p>weird that <code>$(which cargo)</code> doesn't work for you, it works for me locally</p>



<a name="203899207"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203899207" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203899207">(Jul 14 2020 at 23:07)</a>:</h4>
<p>don't spend time on rustc-perf for my sake though, I will always use the dumbest tooling available to me, if i can't use it with my brain completely turned off then I won't use it :P</p>



<a name="203899216"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203899216" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203899216">(Jul 14 2020 at 23:07)</a>:</h4>
<div class="codehilite"><pre><span></span><code>$ which cargo
/home/joshua/.local/lib/cargo/bin/cargo
</code></pre></div>



<a name="203899283"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203899283" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203899283">(Jul 14 2020 at 23:08)</a>:</h4>
<p>yeah I agree rustc_perf is not very user friendly</p>



<a name="203899330"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203899330" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203899330">(Jul 14 2020 at 23:08)</a>:</h4>
<p>(I only use it because I want to get rustdoc up on <a href="http://perf.rust-lang.org">perf.rust-lang.org</a> :P)</p>



<a name="203899448"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203899448" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203899448">(Jul 14 2020 at 23:10)</a>:</h4>
<p>my current workflow would be:</p>
<ul>
<li><code>cd</code> into <code>collector/benchmarks/&lt;bench&gt;</code></li>
<li><code>cargo build -v</code> and copy the rustc invocation</li>
<li>insert <code>+custom-stage1</code> after <code>rustc</code></li>
<li>remove incremental-related args</li>
<li>prefix <code>time</code></li>
</ul>
<p>it's awful but sufficiently dumb for me to do it</p>



<a name="203899695"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203899695" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203899695">(Jul 14 2020 at 23:14)</a>:</h4>
<p>If following the docs doesn't work, that's a problem that needs fixing</p>



<a name="203899706"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203899706" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203899706">(Jul 14 2020 at 23:14)</a>:</h4>
<p>And the commands are awfully complicated, I wonder if they could be improved</p>



<a name="203899743"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203899743" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203899743">(Jul 14 2020 at 23:14)</a>:</h4>
<p>as a simple change, it would be great if <code>--bin</code> worked for subcommands</p>



<a name="203899775"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203899775" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203899775">(Jul 14 2020 at 23:15)</a>:</h4>
<p>right now I have to use <code>cargo run --bin collector -- --db</code> which is very frustrating when I want to change the db, I have to go all the way to the start of the line</p>



<a name="203899849"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203899849" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203899849">(Jul 14 2020 at 23:16)</a>:</h4>
<p>and another possible change is to look for other tools next to rustc and use the ones in path if they're not there</p>



<a name="203899869"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203899869" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203899869">(Jul 14 2020 at 23:16)</a>:</h4>
<p>so instead of <code>--rustc ../rust/build/x86_64-unknown-linux-gnu/stage1/bin/rustc --cargo $(which cargo)</code> you have <code>--exe-dir ../rust/build/x86_64-unknown-linux-gnu/stage1/bin</code> and it looks for both in there</p>



<a name="203899889"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203899889" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203899889">(Jul 14 2020 at 23:16)</a>:</h4>
<p>(maybe print a warning if using the one in PATH)</p>



<a name="203899957"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203899957" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203899957">(Jul 14 2020 at 23:18)</a>:</h4>
<p>and it would be _amazing_ if it could use a rustup toolchain</p>



<a name="203900289"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203900289" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203900289">(Jul 14 2020 at 23:22)</a>:</h4>
<p><span class="user-mention" data-user-id="232545">@Joshua Nelson</span> the docs suggest <code>target/release/collector ...</code>, is that not good for you?</p>



<a name="203900308"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203900308" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203900308">(Jul 14 2020 at 23:22)</a>:</h4>
<p>then I have to remember to recompile after I make a change :/</p>



<a name="203900317"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203900317" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203900317">(Jul 14 2020 at 23:23)</a>:</h4>
<p>it's really easy to use an old version of the code without realizing it</p>



<a name="203900318"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203900318" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203900318">(Jul 14 2020 at 23:23)</a>:</h4>
<p>ok</p>



<a name="203900471"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203900471" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203900471">(Jul 14 2020 at 23:24)</a>:</h4>
<p><span class="user-mention" data-user-id="232545">@Joshua Nelson</span> by "looks for both" do you mean <code>rustc</code> and <code>cargo</code>?</p>



<a name="203900482"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203900482" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203900482">(Jul 14 2020 at 23:24)</a>:</h4>
<p>yes, and now rustdoc</p>



<a name="203900519"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203900519" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203900519">(Jul 14 2020 at 23:25)</a>:</h4>
<p>So my dirs like that only contain <code>rustc</code></p>



<a name="203900522"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203900522" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203900522">(Jul 14 2020 at 23:25)</a>:</h4>
<p>This is for local rustc builds</p>



<a name="203900544"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203900544" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203900544">(Jul 14 2020 at 23:25)</a>:</h4>
<p>I build with <code>./x.py build --stage 2 src/rustc</code>, I wonder if that's relevant</p>



<a name="203900627"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203900627" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203900627">(Jul 14 2020 at 23:26)</a>:</h4>
<p>yeah that only builds rustc, not the tools</p>



<a name="203900653"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203900653" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203900653">(Jul 14 2020 at 23:26)</a>:</h4>
<p>if you use <code>build --stage 1 src/rustc src/tools/rustdoc src/tools/cargo</code> it would build all of them</p>



<a name="203900658"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203900658" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203900658">(Jul 14 2020 at 23:26)</a>:</h4>
<p>(not sure if it's the same for --stage 2 but I assume so)</p>



<a name="203900786"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203900786" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203900786">(Jul 14 2020 at 23:28)</a>:</h4>
<p>Thanks! Specifying a single dir for all tools would definitely be nicer</p>



<a name="203900842"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203900842" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203900842">(Jul 14 2020 at 23:29)</a>:</h4>
<p>Also, we have a bunch of options that aren't really options. E.g. you have to specify <code>--output</code> with <code>profile</code>. So perhaps it should just be a positional argument?</p>



<a name="203900998"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203900998" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203900998">(Jul 14 2020 at 23:31)</a>:</h4>
<p><span class="user-mention" data-user-id="232545">@Joshua Nelson</span> That command you suggested built <code>rustdoc</code>, but not <code>cargo</code></p>



<a name="203901055"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203901055" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203901055">(Jul 14 2020 at 23:32)</a>:</h4>
<p>can you pass multiple targets? I thought that just failed silently</p>



<a name="203901061"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203901061" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203901061">(Jul 14 2020 at 23:32)</a>:</h4>
<p>I know it does for tests</p>



<a name="203901187"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203901187" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203901187">(Jul 14 2020 at 23:34)</a>:</h4>
<p>I just tried several variations, I can't get it to build Cargo</p>



<a name="203901201"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203901201" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203901201">(Jul 14 2020 at 23:34)</a>:</h4>
<p>I can get <code>rustc</code> and <code>rustdoc</code> to both build in a single invocation</p>



<a name="203901321"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203901321" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203901321">(Jul 14 2020 at 23:36)</a>:</h4>
<p>just <code>./x.py build</code> builds <code>rustc</code> and <code>rustdoc</code>, but not <code>cargo</code></p>



<a name="203901805"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203901805" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203901805">(Jul 14 2020 at 23:43)</a>:</h4>
<p>you need <code>tools = ["cargo"]</code> in config.toml, sorry <span class="user-mention" data-user-id="120989">@njn</span></p>



<a name="203901824"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203901824" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203901824">(Jul 14 2020 at 23:43)</a>:</h4>
<p>or actually just <code>extended = true</code></p>



<a name="203901881"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203901881" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203901881">(Jul 14 2020 at 23:44)</a>:</h4>
<p>not sure who decided to make that config.toml instead of a CLI arg <span aria-label="thinking" class="emoji emoji-1f914" role="img" title="thinking">:thinking:</span></p>



<a name="203901941"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203901941" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203901941">(Jul 14 2020 at 23:44)</a>:</h4>
<p><span class="user-mention silent" data-user-id="211727">Jonas Schievink</span> <a href="#narrow/stream/247081-t-compiler.2Fperformance/topic/NRVO/near/203901055">said</a>:</p>
<blockquote>
<p>can you pass multiple targets? I thought that just failed silently</p>
</blockquote>
<p>yes, you can, I use <code>build src/tools/rustdoc src/libstd</code> a lot</p>



<a name="203902011"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203902011" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203902011">(Jul 14 2020 at 23:45)</a>:</h4>
<p>I'm looking closely at all the <code>collector</code> commands and options, it's such a mess</p>



<a name="203902061"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203902061" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203902061">(Jul 14 2020 at 23:46)</a>:</h4>
<p>global options that only apply to some commands; options that are mandatory; etc.</p>



<a name="203902067"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203902067" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203902067">(Jul 14 2020 at 23:46)</a>:</h4>
<p>/me will clean this up</p>



<a name="203903928"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203903928" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203903928">(Jul 15 2020 at 00:15)</a>:</h4>
<p><span class="user-mention" data-user-id="232545">@Joshua Nelson</span> <code>extended = true</code> alone gives me trouble, because <code>rustfmt</code> doesn't build. The suggested full line is  <code>tools = ["cargo", "rls", "clippy", "rustfmt", "analysis", "src"]</code>. What does the <code>"src"</code> do? Also, I think clippy is now built by default anyway...</p>



<a name="203903954"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203903954" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203903954">(Jul 15 2020 at 00:15)</a>:</h4>
<p>I'm not actually sure ... maybe it's related to the <code>rustc-src</code> component of rustup?</p>



<a name="203904016"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203904016" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203904016">(Jul 15 2020 at 00:16)</a>:</h4>
<p>but I think <code>tools = ["cargo"]</code> should be good enough for perf</p>



<a name="203904030"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203904030" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203904030">(Jul 15 2020 at 00:16)</a>:</h4>
<p>Even with that, I still can't get <code>cargo</code> to be built</p>



<a name="203904037"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203904037" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203904037">(Jul 15 2020 at 00:16)</a>:</h4>
<p>maybe <span class="user-mention" data-user-id="120518">@Eric Huss</span> has ideas?</p>



<a name="203904072"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203904072" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203904072">(Jul 15 2020 at 00:17)</a>:</h4>
<p>At least, it doesn't end up in the same dir as <code>rustc</code> and <code>rustdoc</code></p>



<a name="203904089"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203904089" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203904089">(Jul 15 2020 at 00:17)</a>:</h4>
<p>I do get this line "Building stage2 tool cargo (x86_64-unknown-linux-gnu)"</p>



<a name="203904141"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203904141" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203904141">(Jul 15 2020 at 00:18)</a>:</h4>
<p>oh in that case you want <code>stage2-tools</code> I think</p>



<a name="203904153"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203904153" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203904153">(Jul 15 2020 at 00:18)</a>:</h4>
<p>hmm maybe it doesn't make sense to look for cargo with the others ...</p>



<a name="203904218"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203904218" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203904218">(Jul 15 2020 at 00:19)</a>:</h4>
<p>That's a shame, I was hoping to merge <code>--rustc</code> and <code>--cargo</code> options</p>



<a name="203904611"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203904611" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203904611">(Jul 15 2020 at 00:24)</a>:</h4>
<p>I guess we could make the code a bit clever, look for <code>cargo</code> next to <code>rustc</code>, if it's not found, then look in <code>../../stage-2-tools-bin/</code>?</p>



<a name="203904650"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203904650" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203904650">(Jul 15 2020 at 00:25)</a>:</h4>
<p>before you implement that, can you check it's actually in stage2-tools? I don't have cargo built right now haha</p>



<a name="203904659"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203904659" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203904659">(Jul 15 2020 at 00:25)</a>:</h4>
<p>It is</p>



<a name="203904676"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203904676" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203904676">(Jul 15 2020 at 00:25)</a>:</h4>
<p>Don't worry, I test the code I write :)</p>



<a name="203904683"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203904683" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203904683">(Jul 15 2020 at 00:25)</a>:</h4>
<p>how common is it to build cargo from scratch?</p>



<a name="203904754"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203904754" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203904754">(Jul 15 2020 at 00:26)</a>:</h4>
<p>Not common, but we could make it a pre-requisite of doing local profiling?</p>



<a name="203904772"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203904772" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203904772">(Jul 15 2020 at 00:26)</a>:</h4>
<p>Maybe I'll just stick with two options for now</p>



<a name="203904774"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203904774" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203904774">(Jul 15 2020 at 00:26)</a>:</h4>
<p><code>x.py build src/tools/cargo</code> will place cargo in the <code>stage2-tools</code> directory.  I think <code>dist</code> or <code>install</code> will package everything together.  But why do you need cargo at all?</p>



<a name="203904789"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203904789" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203904789">(Jul 15 2020 at 00:27)</a>:</h4>
<p>rustc-perf uses cargo</p>



<a name="203904804"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203904804" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203904804">(Jul 15 2020 at 00:27)</a>:</h4>
<p>to build each benchmark</p>



<a name="203904884"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203904884" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203904884">(Jul 15 2020 at 00:28)</a>:</h4>
<p>Usually it should be fine to use nightly cargo.</p>



<a name="203904891"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203904891" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203904891">(Jul 15 2020 at 00:28)</a>:</h4>
<p>I'm not sure what your setup is (if you use rustup or even have nightly installed)</p>



<a name="203904947"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203904947" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203904947">(Jul 15 2020 at 00:29)</a>:</h4>
<p>Usually nightly cargo is fine. Currently for local profiling you have to specify both a rustc executable and a cargo executable, which is just a bit of a pain</p>



<a name="203904963"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203904963" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203904963">(Jul 15 2020 at 00:29)</a>:</h4>
<p>It would be nice if we could specify a single dir, and have it find both <code>rustc</code> and <code>cargo</code> from that</p>



<a name="203905040"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203905040" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203905040">(Jul 15 2020 at 00:30)</a>:</h4>
<p><span class="user-mention" data-user-id="120989">@njn</span> whenever I see this used people use <code>--cargo $(which cargo)</code></p>



<a name="203905054"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203905054" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203905054">(Jul 15 2020 at 00:31)</a>:</h4>
<p>can we do that inside collector?</p>



<a name="203905061"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203905061" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203905061">(Jul 15 2020 at 00:31)</a>:</h4>
<p>i guess we could</p>



<a name="203906039"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/NRVO/near/203906039" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/NRVO.html#203906039">(Jul 15 2020 at 00:46)</a>:</h4>
<p>technically you probably want something like rustup which cargo --toolchain nightly ideally</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>